var teacher = require('../teacher-home/model/TeacherModel.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    web_url:"",
    teachername:"",
    teacherId:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var teacherid = options.teacherId;
    // var web_url;
    var teachername = options.teachername;
    var that = this
    this.setData({
      web_url: 'https://www.yuandingxiake.com/web/index.php?g=portal&m=index&a=index&id=' + teacherid,
      teachername: teachername,
      teacherId :teacherid
    })
    
  },
  
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var that = this
    var teacherid = that.data.teacherId;
    var teachername = that.data.teachername;
    var title = teachername + "微官网"
    console.log(teachername)
    var shareObject = {
      title: teachername + "微官网" ,
      path: 'pages/website-official/website?teacherId=' + teacherid + "&teachername=" + teachername,
      // imageUrl: this.data.courseDetailInfo.cover,
      success: function (res) {
        wx.showToast({
          title: '分享成功',
          icon: ''
        })
      }
    }
    return shareObject;
  },
})